package com.itheima;

import com.itheima.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Xiao
 * @date 2021/9/11
 */
public class App05 {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookDao bookDao = (BookDao) ctx.getBean("bookDaoFB");
        bookDao.save();
        //ctx.close();  //手工关闭容器
        ctx.registerShutdownHook(); //注册关闭钩子
    }
}
